﻿using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rosetta.Default.AddIns;

namespace Rosetta.Tests.Default
{
    [TestClass]
    public class RangeConverterTests
    {
        #region Public Methods

        [TestMethod]
        public void TestCharRange()
        {
            var rangeConverter = new RangeConverter();

            var getCharRange = rangeConverter.Convert<char, char, IEnumerable<char>>("GetCharRange");

            var ascRange = getCharRange('a', 'd').ToArray();
            Assert.AreEqual(4, ascRange.Length);
            Assert.AreEqual('b', ascRange[1]);

            var descRange = getCharRange('d', 'a').ToArray();
            Assert.AreEqual(4, descRange.Length);
            Assert.AreEqual('c', descRange[1]);
        }

        #endregion
    }
}